<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      body {
        width: 100vw;
        height: 800px;
        background-color: skyblue;
      }
      .heart {
        /* margin: 300px auto 0; */
        width: 200px;
        height: 200px;
        background-color: pink;
        position: relative;
        transform: rotate(45deg) scale(0.5);
        animation: beat 2s infinite;
      }
      .heart::before,
      .heart::after {
        content: '';
        position: absolute;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        background-color: pink;
      }
      /* 定位不一样 */
      .heart::before {
        transform: translate(-100px);
      }
      .heart::after {
        transform: translateY(-100px);
      }
      .box {
        margin: 400px auto;
        width: 210px;
        height: 210px;
        animation: move 1s infinite alternate-reverse;
      }
      .shadow {
        margin: 0 auto;
        position: relative;
        width: 200px;
        height: 50px;
        border-radius: 50%;
        background-color: rgba(0, 0, 0, 0.3);
        filter: blur(15px);
        top: -450px;
        animation: change 1s infinite alternate-reverse;
      }
      /* 上下移动 */
      @keyframes move {
        100% {
          transform: translateY(-300px);
        }
      }
      /* 爱心放大缩小 透明度变化 */
      @keyframes beat {
        25% {
          transform: scale(1) rotate(45deg);
          opacity: 1;
        }
        50% {
          transform: scale(0.5) rotate(45deg);
          opacity: 0.5;
        }
        75% {
          transform: scale(1) rotate(45deg);
          opacity: 1;
        }
        100% {
          transform: scale(0.5) rotate(45deg);
          opacity: 0.5;
        }
      }
      /* 阴影动画 */
      @keyframes change {
        100% {
          width: 200px;
          height: 20px;
          background-color: rgba(0, 0, 0, 0.1);
          filter: blur(35px);
        }
      }
    </style>
  </head>
  <body>
    <!-- 外层盒子用来上下移动 -->
    <div class="box">
      <!-- 装❤️的盒子 -->
      <div class="heart"></div>
    </div>
    <!-- 阴影 -->
    <div class="shadow"></div>
  </body>
</html>
